<template>
  <div>
    <van-nav-bar left-text="返回" left-arrow>
      <template #right>
        <van-icon name="search" size="18" />
      </template>

      <template #title>
        <van-button size="small" v-for="(v, i) in list" :key="i">{{ v.title }}</van-button>
      </template>
    </van-nav-bar>

  </div>
</template>


<script lang="ts" setup>
import axios from 'axios';
import { ref } from 'vue'

interface ListState {
  title: string
}

const list = ref<ListState[]>([]);

const getList = async () => {
  const resp = await axios.get('/api/list')
  list.value = resp.data
  console.log(resp.data)
}
getList()
</script>